				SIGNED-RANK TEST

(Also called Wilcoxon's signed-rank test.)

Michael Lloyd (http://www.hsu.edu/faculty/lloydm/ti/prgmtabl.html)
Henderson State University

HISTORY
1.0 December 1997
1.1 August 2015 - Updated file to .8xp


INSTRUCTIONS
The program will prompt for the list containing your 
data. The following are displayed:

sum of the positive ranks T+
sum of the negative ranks T-
maximum(T+,T-)=T
population mean of T = M
population standard deviation of T = S
Z score of T

VARIABLES USED
A = used
I,J,K = counters
L = original sample size
list thetaD = data which will be purged of zeros
list RANK = ranks
list TEMP = absolute value of data
list thetaO = order of data, zeros
M = sum of ranks, mean of test statistic
N = number of nonzero data
S = standard deviation of test statistic
T = sum of positive ranks, test statistic
Z = z score of test statistic

PROGRAM LISTING
Disp "SIGNED-RANK TEST"
Input "DATA=",\L\\theta\D
dim(\L\\theta\D)\->\L
0\->\dim(\L\TEMP)
0\->\N
For(I,1,L)
If \L\\theta\D(I)
Then
N+1\->\N
\L\\theta\D(I)\->\\L\TEMP(N)
End:End
Disp "N=",N
\L\TEMP\->\\L\\theta\D
abs(\L\TEMP)\->\\L\TEMP
seq(X,X,1,N)\->\\L\\theta\O
\L\\theta\O\->\\L\RANK
SortA(\L\TEMP,\L\\theta\O)
prgmZZRANK
SortA(\L\\theta\O,\L\RANK)
Fill(0,\L\\theta\O)
sum((\L\\theta\D>\L\\theta\O)\L\RANK)\->\T
N(N+1)/2\->\M
Disp "T+=",T
Disp "T-=",M-T
Pause 
If T<M/2:M-T\->\T
Disp "T=",T
M/2\->\M:\root\(M(2N+1)/6)\->\S
Disp "MEAN=",M
Disp "STD DEV=",S
Pause 
(T-M)/S\->\Z
Disp "Z=",Z
DelVar \L\\theta\O:DelVar \L\TEMP:DelVar \L\RANK:DelVar \L\\theta\D
